package com.shop.category;

import com.alibaba.fastjson.JSONObject;
import com.shop.base.BaseResponse;
import com.shop.goods.inputDTO.CategoryMessageDTO;
import com.shop.goods.outputtDTO.OneCategoryDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: 王瑞文
 * Date: 2020/9/6
 * Time: 18:00
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Api(tags = "分类服务")
public interface CategoryService {
    /**
     * 获取分类
     *
     * @return
     */
    @GetMapping("getTree")
    @ApiOperation("获取所有分类")
    BaseResponse<List<OneCategoryDTO>> getTree();

    /**
     * 添加分类
     * @param categoryMessageDTO
     * @return
     */
    @PostMapping("addCategory")
    @ApiOperation("添加分类")
    BaseResponse<JSONObject> addCategory(@RequestBody CategoryMessageDTO categoryMessageDTO);

    /**
     * 删除分类
     * @param id
     * @return
     */
    @DeleteMapping("deleteCategory")
    @ApiOperation("删除分类")
    BaseResponse<JSONObject >deleteCategory(@RequestParam("id") String id);
}
